class Solution {
public:
    int differenceOfSum(vector<int>& nums)
    {
        int ans = 0;
        for (int i = 0; i < nums.size(); i++)
        {
            int x = nums[i];
            while (x)
            {
                ans += x % 10;
                x /= 10;
            }
        }
        return abs(ans - accumulate(nums.begin(), nums.end(), 0));
    }
};